<?php

namespace application\entity;

class Response {

    const SUCCESS = "Thành công";
    const Fail = "Thất bại";

    public $success = false;
    public $message = null;
    public $data = null;

    public function __construct($success = false, $message = null, $data = null) {
        $this->success = $success;
        $this->message = $message;
        $this->data = $data;
    }

    public function resultData() {
        $objec["success"] = $this->success;
        $objec["message"] = $this->message;
        $objec["data"] = $this->data;
        echo json_encode($objec);
    }

}
